﻿<Page x:Class="SsTool.Core.SubPages.RoleNavigationPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="500"
	Title="RoleNavigationViews">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <DataGrid Name="_ctlGridRole" Grid.Column="0" BorderThickness="0" CanUserAddRows="False" IsReadOnly="True" SelectionChanged="_ctlGridRole_SelectionChanged">
        </DataGrid>

        <TabControl Grid.Column="1" Margin="5,0,0,0">
            <TabItem Header="设置导航">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal">
                        <Button Content="保存" Name="_ctlBtnSave" Click="_ctlBtnSave_Click"/>
                    </StackPanel>
                    <TreeView Grid.Row="1" Name="_ctlTreeNavigation" VerticalAlignment="Stretch" BorderThickness="0">
                        <TreeView.Resources>
                            <Style TargetType="TreeViewItem">
                                <Setter Property="IsExpanded" Value="True"/>
                            </Style>
                        </TreeView.Resources>
                        <TreeView.ItemTemplate>
                            <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                                <StackPanel Orientation="Horizontal">
                                    <CheckBox IsChecked="{Binding IsSelected,Mode=TwoWay}"/>
                                    <Image Source="../Resources/folder.png" Margin="0,0,5,0"/>
                                    <TextBlock Text="{Binding Path=Data.Caption}" VerticalAlignment="Center"/>
                                </StackPanel>
                            </HierarchicalDataTemplate>
                        </TreeView.ItemTemplate>
                    </TreeView>
                </Grid>
            </TabItem>
            <TabItem Header="现有导航">
                <TreeView Name="_ctlTreeRoleNavigation" VerticalAlignment="Stretch" BorderThickness="0">
                    <TreeView.Resources>
                        <Style TargetType="TreeViewItem">
                            <Setter Property="IsExpanded" Value="True"/>
                        </Style>
                    </TreeView.Resources>
                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../Resources/folder.png" Margin="0,0,5,0"/>
                                <TextBlock Text="{Binding Path=Caption}" VerticalAlignment="Center"/>
                            </StackPanel>
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
            </TabItem>
            <TabItem Header="现有快捷方式">
                <DataGrid Name="_ctlGridShortcuts" AutoGenerateColumns="False" CanUserAddRows="True" IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="名称" Binding="{Binding Path=Caption}"/>
                        <DataGridTextColumn Header="导航名称" Binding="{Binding Path=Navigation.Caption}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
        </TabControl>
    </Grid>
</Page>
